import httpFetch from "share/httpFetch";

export default {

  saveSubject(params,userOID) {
    return httpFetch[params.id ? 'put' : 'post'](`/ledger/api/account/set?operatorOid=${userOID}`, params)
  },

  getSubjectDetail(id) {
    return httpFetch.get(`/ledger/api/account/set/${id}`)
  },

  getSubjectDetailList(params) {
    return httpFetch.get(`/ledger/api/accounts/query`, params)
  },

  getSubSubject(params) {
    return httpFetch.get(`/ledger/api/accounts/hierarchy/parent/query`, params)
  },

  deleteSubSubject(id) {
    return httpFetch.delete(`/ledger/api/accounts/hierarchy/${id}`)
  },

  batchDelete(ids) {
    return httpFetch.delete(`/ledger/api/accounts/hierarchy/batch/delete`, ids)
  },

  addSubSubject(params) {
    return httpFetch.post(`/ledger/api/accounts/hierarchy/batch/insert`, params)
  },

  saveSubSubjectDetail(params, userOid) {
    return httpFetch[params.id ? 'put' : 'post'](`/ledger/api/accounts?operatorOid=${userOid}`, params)
  }

}
